<html>
<head>
	<script src="../js/dojo/dojo.js"></script>
	<script src="../js/dair/Aliases.js"></script>
	<script src="../js/dair/Application.js"></script>
	<script type="text/javascript">
		dojo.require("dair.Application");
		dojo.addOnLoad(function(){
		
			air.trace('app loaded');
			var myApp = new dair.Application();

			var win1 = myApp.addWindow({
				size:{
					h:"25%", w:"25%"
				},
				href:"app:/tests/WindowData.html"
			});

			var win2 = myApp.addWindow({
				href:"app:/tests/WindowData.html",
				size:{
					h:350, w:350, t:210, l:210
				},
				fullscreen:true,
				resizable:false
			});
			setTimeout(function(){
				win2.attr("position", { w:"15%", h:"15%" });
			}, 2000);

			var win3 = new dair.Window({
				href:"app:/tests/WindowData.html",
				size:{
					h:175, w:175, t:175, l:175
				},
				resizable: false
			});
			myApp.addWindow(win3);
			setTimeout(function(){
				air.trace('removing third window');
				myApp.removeWindow(win3);
			}, 3000);

			myApp.addWindow(new dair.Window({ size:{ h:100, w:100 }, type:"utility" }));
			
			dojo.query("#cascade").connect('onclick', myApp, 'cascadeWindows');
			dojo.query("#shutdown").connect('onclick', myApp, 'shutdown');
			
		});
	</script>
</head>
<body>
	<h1>Sample</h1>
	
	<button id="cascade">cascade</button>
	<button id="shutdown">shutdown</button>
	
</body>
</html>